package cn.zch.controller;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Component
@Controller
@Slf4j
@RequestMapping("/test/zch")
public class ZchTestController {
  @RequestMapping("/zt1")
  public void test1Zch(HttpServletRequest request, HttpServletResponse response) {
    String testStr1 = "测试输出test1Zch:" + this.getClass().getName();
    log.info(testStr1);
    System.out.println(testStr1);
    // return "test1Zch";
  }
  @ResponseBody
  @RequestMapping("/zt2")
  public String test2Zch(HttpServletRequest request, HttpServletResponse response) {
    String testStr1 = "测试输出test2Zch:" + this.getClass().getName();
    log.info(testStr1);
    System.out.println(testStr1);
    return JSON.toJSONString(request.getParameterNames());
    // return "test1Zch";
  }
}
